export const rules = {
    userName: [
        { required: true, message: '请输入用户名', trigger: 'blur' },
        { min: 2, max: 20, message: '用户名长度2-20位', trigger: 'blur' },
        {
            pattern: new RegExp(/^((?!\+|\.|\\|\/|:|\*|\?|\!|<|>|\||'|%|@|#|&|\$|\^|&|\*).){1,50}$/),
            message: '名称不允许包含特殊字符',
            trigger: 'blur'
        }
    ],
    userPassword: [
        { required: true, message: '请输入用户密码', trigger: 'blur' },
        { min: 6, max: 20, message: '用户密码长度2-20位', trigger: 'blur' },
    ],
    telephone: [
        { required: true, message: '请输入手机号', trigger: 'blur' },
        { pattern: /^1[3|4|5|7|8][0-9]\d{8}$/, message: '请输入正确的手机号' }
    ],
    email: [
        { required: true, message: '请输入邮箱', trigger: 'blur' },
        { pattern: /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/, message: '请输入正确的邮箱' }
    ],
    roleName: [
        {
            required: true,
            message: '请选择角色类型',
            trigger: 'change',
        },
    ],
    deptName: [
        {
            required: true,
            message: '请选择所属部门',
            trigger: 'change',
        },
    ],
}